home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / watcom / w_512400 / c512.txt < prev    next >
Encoding:
Text File  |  1995-01-08  |  3.7 KB  |  76 lines

  1.  
  2.  Here you have 512x400 in a chained 8 bit video mode.  This is the WATCOM
  3.  version of Anthony Tavener's MODE-C1.ZIP (I think he is the one who did it)
  4.  
  5.  This conversion to WATCOM was performed by:
  6.  
  7.    John McCarthy
  8.    1316 Redwood Lane
  9.    Pickering, Ontario.
  10.    Canada, Earth, Milky Way (for those out-of-towners)
  11.    L1X 1C5
  12.    brian.mccarthy@canrem.com
  13.  
  14.  Send me a postcard from someplace near where you live!
  15.  
  16.  To implement the video mode:  set_512x400();
  17.  To change the video plane  :  set_plane(char);  where char is 0,16,32 or 48
  18.  To plot a pixel            :  pixel_plot(int x, int y, char colour);
  19.  
  20.  John McCarthy thanks those who created the 512x400 video mode and hopes
  21.  he has not offended them with his conversion.
  22.  
  23.  Here is an excerpt from the original file MODE-C1.ZIP by Anthony Tavener
  24.  
  25. ------------------------------------------------------------------------------
  26.  
  27. The mode is something I call ModeC1, because numbers are kind of used up,
  28. and many letters too.  The 'C' stands for chained, unlike Xmode's unchained
  29. structure.  The '1' indicates which 'modeC' (512x400x8bit in this case).
  30. If you have a better naming scheme, use it - I just don't like writing big
  31. labels in my code :).
  32.  
  33. There are a few advantages to a mode like this.  One is the decent resolution.
  34. Most games use 320x200/240.  The next step (other than pinched-for-memory
  35. modeX variants) is 640x480 (or that 400 line mutant freakish mode :).  Three
  36. hundred thousand pixels for one screen is a lot to push around at good frame
  37. rates - two hundred thousand isn't quite as bad.  Sixty or seventy thousand
  38. is getting too easy, and just plain looks bad.  I don't like bad-guys right in
  39. my face before I can dicern what they look like!
  40.  
  41. Other advantages are related to the horizontal resolution of 512 pixels.  This
  42. allows easy transformation from x,y pairs to linear addresses - a common
  43. function.  Also, paging is much easier.  With 4k page granularity, 8 lines
  44. fits perfectly.  Alignment occurs at 20k intervals with 640 pixels.
  45.  
  46. The code should work on any 386+ with a CLGD-54xx based card.  If it doesn't,
  47. please let me know (via email preferably).  If you want to muck around with the
  48. register settings be careful; I've had no damage done to anything, and newer
  49. equipment is quite resilient, but there is always a possibility of breaking
  50. something!  I briefly indicated some of the important SVGA registers relating
  51. to resolution.  The dot-clock must be changed to match your resolution too
  52. (If you stay between about 200000-350000 pixel screen I think 25MHz should be
  53. okay).  You'll know if the dot-clock is bad - too high and the screen will be
  54. very dark and take a while to stabilize; too low, the screen will be faded.
  55. If you read vidmodes.txt (VideoModes.doc from Linux XF86 distribution), you
  56. may notice that the dot clocks on cards favor the common resolutions.  So
  57. modes with really odd resolutions may not be practical.
  58.  
  59. For those wishing to create modes for other chipsets, make some comparisons
  60. between the regster functionality presented in the cirrus documentation, and
  61. you card's docs.  Note that the standard VGA registers carry most of the
  62. burden relating to modes.
  63.  
  64. Reminder: I take NO responibility for the actions of others.  If you blow up
  65. your hardware that's your problem.  I, personally, haven't had any problems,
  66. but messing with things like this is has it's potential hazards.
  67.  
  68. I would like to thank Finn Thoegerson for compiling vgadoc3, and
  69. Chin Fang, Bob Crosson, and Eric S. Raymond for 'The Hitchiker's Guide
  70. to XFree86 Video Timing'.  I wouldn't have gotten very far without both
  71. of these!
  72.  
  73. -Daoloth of MetaSentience  (Anthony Tavener)
  74. -cs94169@cs.ualberta.ca
  75.   (This is temporary, a friend's account)
  76.